<?php


namespace App\Models;


use App\Supports\DateSupport;
use Base\BaseModel;

class GiveCommentModel extends BaseModel
{
    protected $table = 'give_comment';

    public function insertComment($data)
    {
        return $this->baseInsert($data);
    }

    public function getCommentRowById($id, $fields = '*')
    {
        return $this->baseSelectFirst($fields, [
            'id' => $id,
            'is_del' => 0
        ]);
    }

    public function fakeDeleteComment($id, $uid)
    {
        return $this->baseUpdate([
            'id' => $id
        ], [
            'is_del' => 1,
            'modify_user' => $uid,
            'modify_time' => DateSupport::nowDate()
        ]);
    }

    public function getListCount($where)
    {
        return $this->baseSelectCount($where);
    }

    public function getListByPage($where, $fields = '*', $limit = 20, $page = 1)
    {
        return $this->baseSelectByPage($where, $fields, $limit, $page);
    }
}
